package com.boyu.common.config;

import com.boyu.backend.*;
import com.boyu.common.interceptor.AdminAuthInterceptor;
import com.boyu.common.interceptor.ContextInterceptor;
import com.jfinal.config.Routes;

/**
 * Created by legend9999 on 2016/8/28.
 */
public class BackendRoutes extends Routes {
    public static final String BACKEND = "/backend";

    public void config() {
        addInterceptor(new ContextInterceptor());
        addInterceptor(new AdminAuthInterceptor());
        setBaseViewPath("/WEB-INF/views/");
        add(BACKEND, _IndexController.class);

        add(BACKEND + "/user", _UserController.class);
        add(BACKEND + "/fuser", _FuserController.class);
        add(BACKEND + "/menu", _MenuController.class);
        add(BACKEND + "/column", _ColumnController.class);
        add(BACKEND + "/article", _ArticleController.class);
        add(BACKEND + "/option", _OptionController.class);
        add(BACKEND + "/product_attr", _ProductAttrController.class);
        add(BACKEND + "/system_attr", _SystemAttrController.class);
        add(BACKEND + "/product", _ProductController.class);
        add(BACKEND + "/product_image", _ProductImageController.class);
    }
}

